package com.xiaoshuidi.cloud.module.finance.api.finance;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.finance.api.finance.dto.FinanceAccountDTO;
import com.xiaoshuidi.cloud.module.finance.convert.finance.FinanceConvert;
import com.xiaoshuidi.cloud.module.finance.dal.dataobject.finance.FinanceAccountDO;
import com.xiaoshuidi.cloud.module.finance.service.finance.FinanceAccountService;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class FinanceAccountApiImpl implements FinanceAccountApi {
    @Resource
    private FinanceAccountService financeAccountService;

    @Override
    public CommonResult<FinanceAccountDTO> getAccount(String custId, String custType) {
        FinanceAccountDO financeAccountDO = financeAccountService.get(custId, custType);
        return CommonResult.success(FinanceConvert.INSTANCE.convert2(financeAccountDO));
    }
}
